﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Admin_ShopDetail : System.Web.UI.Page
{
    Funtion ft = new Funtion();
    tblShopDetail sd;
    protected void Page_Load(object sender, EventArgs e)
    {
        if(this.IsPostBack==false)
        {
            //string shopid = ft.GetShopID1();
            sd = new tblShopDetail();
            sd = ft.GetShopDetailID("SH01");
            lblShopDIDS.Text = sd.ShopDID;
            lblShopIDS.Text  = sd.ShopID;
            lblShopNameS.Text = sd.ShopName;
            lblAboutUsS.Text = sd.AboutUs;
            lblLocationS.Text = sd.Location;
            lblNotesS.Text = sd.Notes;
        }

    }
    protected void lbtnEdit_Click(object sender, EventArgs e)
    {
        lblShopNameS.Visible = false;
        lbtnEdit.Visible = false;
        txtShopName.Visible = true;
        lbtnUpdate.Visible = true;
        lbtnCancel.Visible = true;
    }
    protected void lbtnEdit1_Click(object sender, EventArgs e)
    {
        lblAboutUsS.Visible = false;
        lbtnEdit1.Visible = false;
        txtAboutUs.Visible = true;
        lbtnUpdate0.Visible = true;
        lbtnCancel0.Visible = true;
    }
    protected void lbtnEdit2_Click(object sender, EventArgs e)
    {
        lblNotesS.Visible = false;
        lbtnEdit2.Visible = false;
        txtNotes.Visible = true;
        lbtnUpdate1.Visible = true;
        lbtnCancel1.Visible = true;
    }
    protected void lbtnUpdate_Click(object sender, EventArgs e)
    {
        if(ft.UpdateShopDetail(lblShopIDS.Text,txtShopName.Text,lblAboutUsS.Text,lblNotesS.Text))
        {
         ft.UpdateShop2(lblShopIDS.Text,txtShopName.Text);
         lblShopNameS.Visible = true;
         lblShopNameS.Text = txtShopName.Text;
         txtShopName.Visible = false;
         lbtnEdit.Visible = true;
         lbtnUpdate.Visible = false;
         lbtnCancel.Visible = false;
        }
    }
    protected void lbtnUpdate0_Click(object sender, EventArgs e)
    {
        if (ft.UpdateShopDetail(lblShopIDS.Text, lblShopNameS.Text, txtAboutUs.Text, lblNotesS.Text))
        {
            lblAboutUsS.Visible = true;
            lblAboutUsS.Text = txtAboutUs.Text;
            txtAboutUs.Visible = false;
            lbtnEdit1.Visible = true;
            lbtnUpdate0.Visible = false;
            lbtnCancel0.Visible = false;
        }
    }
    protected void lbtnUpdate1_Click(object sender, EventArgs e)
    {
        if (ft.UpdateShopDetail(lblShopIDS.Text, lblShopNameS.Text, lblAboutUsS.Text, txtNotes.Text))
        {
            lblNotesS.Visible = true;
            lblNotesS.Text = txtNotes.Text;
            txtNotes.Visible = false;
            lbtnEdit2.Visible = true;
            lbtnUpdate1.Visible = false;
            lbtnCancel1.Visible = false;
        }
    }
    protected void lbtnCancel_Click(object sender, EventArgs e)
    {
        lblShopNameS.Visible = true;
        txtShopName.Visible = false;
        lbtnEdit.Visible = true;
        lbtnUpdate.Visible = false;
        lbtnCancel.Visible = false;
    }
    protected void lbtnCancel0_Click(object sender, EventArgs e)
    {
        lblAboutUsS.Visible = true;
        txtAboutUs.Visible = false;
        lbtnEdit1.Visible = true;
        lbtnUpdate0.Visible = false;
        lbtnCancel0.Visible = false;
    }
    protected void lbtnCancel1_Click(object sender, EventArgs e)
    {
        lblNotesS.Visible = true;
        txtNotes.Visible = false;
        lbtnEdit2.Visible = true;
        lbtnUpdate1.Visible = false;
        lbtnCancel1.Visible = false;
    }
}